<template>
  <div class="app-container">
    <el-link
      href="https://cropper.chengpeiquan.com/zh/"
      type="primary"
      target="_blank"
      class="mb-[20px]"
    >
      官网文档 >>>>
    </el-link>
    <el-form>
      <el-form-item label="图片上传">
        <IconUpload
          v-model="value"
          :presetMode="{ width: 295, height: 413 }"
          :title="'上传图片'"
        ></IconUpload>
      </el-form-item>
      <el-form-item label="参数说明">
        <el-table :data="imageUploadArgData" border>
          <el-table-column prop="argsName" label="参数名称" width="100" />
          <el-table-column prop="type" label="参数类型" width="100" />
          <el-table-column prop="default" label="默认值" width="400" />
          <el-table-column prop="desc" label="描述"  />
        </el-table>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup lang="ts">
defineOptions({
  name: "ImageCropper",
  inheritAttrs: false,
});
const imageUploadArgData = [
  {
    argsName: "v-model",
    type: "Object",
    default: "",
    desc: "裁剪后图片Base64编码",
  },
  {
    argsName: "presetMode",
    type: "String",
    default: "{ width: 295, height: 413 }",
    desc: "裁剪窗口的长宽，及裁剪图片大小",
  },
  {
    argsName: "title",
    type: "String",
    default: "上传图片",
    desc: "组件内容",
  },
];

const value = ref("");
</script>

<style lang="scss" scoped></style>
